// ========== Common 模块 ==========
export const EnableStatusEnum = {
  Enabled: 0,
  Disabled: 1
}

export const GenderEnum = {
  Unknown: 0,
  Male: 1,
  Female: 2
}

export const UserTypeEnum = {
  Staff: 'S',
  Member: 'M'
}

export const BoolFlagEnum = {
  Yes: 'Y',
  No: 'N'
}

export const UserSelectScopeEnum = {
  All: 0, // 全部用户
  Selected: 1 // 指定用户
}

export const SocialTypeEnum = {
  DingTalk: {
    type: 20,
    title: '钉钉',
    source: 'DINGTALK',
    img: 'https://s1.ax1x.com/2022/05/22/OzMDRs.png',
    enabled: false
  },
  Wechat_Enterprise: {
    type: 30,
    title: '企业微信',
    source: 'WECHAT_ENTERPRISE',
    img: 'https://s1.ax1x.com/2022/05/22/OzMrzn.png',
    enabled: true
  },
  Wechat_Mp: {
    type: 31,
    title: '微信公众号',
    source: 'WECHAT_MP',
    img: '',
    enabled: false
  },
  Wechat_Open: {
    type: 32,
    title: '微信开放平台',
    source: 'WECHAT_OPEN',
    img: '',
    enabled: false
  },
  Wechat_MiniApp: {
    type: 34,
    title: '微信小程序',
    source: 'WECHAT_MINI_APP',
    img: '',
    enabled: false
  }
}

// ========== Infra 模块 ==========
export const InfraCodegenTemplateTypeEnum = {
  Single: 1,
  Tree: 2,
  Master_Normal: 10,
  Master_Cascade: 11,
  Master_Nested: 12,
  Sub: 20
}

// ========== System 模块 ==========
export const SystemSmsSceneEnum = {
  Staff_Sms_Login: '01',
  Staff_Reset_Passwd: '02'
}

export const SystemMenuTypeEnum = {
  Dir: 'D',
  Menu: 'M',
  Button: 'B'
}

export const SystemRoleTypeEnum = {
  System: 1,
  Custom: 2
}

export const SystemRoleCodeEnum = {
  Super_Admin: 'super_admin',
  Tenant_Admin: 'tenant_admin'
}

export const SystemDataScopeEnum = {
  All: 1,
  Dept_Custom: 2,
  Dept_Only: 3,
  Dept_And_Child: 4,
  Self: 5
}

export const SystemMailTemplateTypeEnum = {
  Placeholder: 'placeholder',
  Freemarker: 'freemarker'
}

// ========== BPM 模块 ==========
export const BpmModelTypeEnum = {
  Bpmn: 10 // bpmn设计模型
}

export const BpmModelStatusEnum = {
  Active: 1, // 启用状态
  Suspended: 2 // 停用状态
}

export const BpmModelFormTypeEnum = {
  Normal: 10, // 流程表单
  Custom: 20 // 业务表单
}

export const BpmAutoApproveTypeEnum = {
  None: 0, // 不自动通过
  Approve_All: 1, // 仅审批一次，后续重复审批节点自动通过
  Approve_Sequent: 2 // 仅针对连续审批的节点自动通过
}

export const BpmProcessVariableEnum = {
  Process_Definition_Name: 'PROCESS_DEFINITION_NAME',
  Start_Time: 'PROCESS_START_TIME',
  Start_User_Id: 'PROCESS_START_USER_ID'
}

/**
 * 任务状态枚举
 */
// todo rename to BpmTaskStatusEnum
export enum TaskStatusEnum {
  /**
   * 未开始
   */
  NOT_START = -1,

  /**
   * 待审批
   */
  WAIT = 0,
  /**
   * 审批中
   */
  RUNNING = 1,
  /**
   * 审批通过
   */
  APPROVE = 2,

  /**
   * 审批不通过
   */
  REJECT = 3,

  /**
   * 已取消
   */
  CANCEL = 4,
  /**
   * 已退回
   */
  RETURN = 5,
  /**
   * 审批通过中
   */
  APPROVING = 7
}

export const BpmProcessInstanceStatusEnum = {
  NOT_START: -1, // 未开始
  RUNNING: 1, // 审批中
  APPROVE: 2, // 审批通过
  REJECT: 3, // 审批不通过
  CANCEL: 4 // 已取消
}
